import Vue from 'vue'
import 'lib-flexible'
import App from './App.vue'
import router from '@/router'
import store from '@/store'
import SvgIcon from 'components/SvgIcon'
import '@/icons' // icon
import '@/style/common.scss'
import '@/style/_mixin.scss'
import '@/style/_variables.scss'
import 'vo-pages/lib/vo-pages.css'
import 'vant/lib/icon/local.css';
import 'vant/lib/index.css';
import { init, bind } from 'utils/custom-life-cycle'
import down from '@/utils/index.js'
import { Lazyload, NavBar, Swipe, SwipeItem, Icon, Dialog, Uploader, Search, Tabbar, TabbarItem, Tab, Tabs, Pagination, Col, Row, ImagePreview, Grid, GridItem, Notify, Empty, Skeleton } from 'vant'
Vue.use(Lazyload, {
    lazyComponent: true,
}).use(NavBar).use(Swipe).use(SwipeItem).use(Icon).use(Dialog).use(Uploader).use(Search).use(Tabbar).use(TabbarItem).use(Tab).use(Tabs).use(Pagination).use(Col).use(Row).use(ImagePreview).use(Grid).use(GridItem).use(Notify).use(Empty).use(Skeleton);
import defaultSettings from '@/settings'

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */
import { mockXHR } from '../mock'

if (process.env.NODE_ENV === 'production') {
    mockXHR()
}

// import {Tabbar,TabbarItem} from 'vant'     //vant全局注册
// [Tabbar,TabbarItem].forEach(e=>{
//   Vue.use(e)
// })

// options 为可选参数，无则不传
// 初始化生命周期函数, 必须在Vue实例化之前确定合并策略
init()


Vue.component('svg-icon', SvgIcon)

if (process.env.NODE_ENV === 'development' && defaultSettings.vconsole) {
    const VConsole = require('vconsole')
        // eslint-disable-next-line
    const my_console = new VConsole()
}
// var vConsole = new VConsole(option)

Vue.config.productionTip = false

const vm = new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
bind(vm)